
//
//  HomePlayView.m
//  sanmuBoom
//
//  Created by 杨森 on 2017/5/16.
//  Copyright © 2017年 sanmu. All rights reserved.
//

#import "HomePlayView.h"

@implementation HomePlayView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self =[super initWithFrame:frame]) {
        [self buildViews];
    }
    return self;
}

- (void)buildViews
{

    [self addSubview:self.contentImg];
    [self addSubview:self.contentLabel];
    [self addSubview:self.contentPrice];
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    
//    CGFloat margin = 15;
    

    self.contentImg.frame = CGRectMake(0,0,self.width,80);
    self.contentLabel.frame = CGRectMake(0,CGRectGetMaxY(_contentImg.frame)+5,self.width,30);
    
    
        WeakSelf(self);
    [self.contentPrice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakself);
        make.bottom.equalTo(weakself);
        make.width.equalTo(weakself);
    }];
}

- (UIImageView *)contentImg
{
    if (!_contentImg) {
        _contentImg = [[UIImageView alloc] init];
    }return _contentImg;
}

- (UILabel *)contentLabel
{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.numberOfLines = 0;
        _contentLabel.font = FONT(12);
        _contentLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _contentLabel;
}

- (UILabel *)contentPrice
{
    if (!_contentPrice) {
        _contentPrice = [[UILabel alloc] init];
        _contentPrice.textColor = DEFAULT_COLOR;
        _contentPrice.font = FONT(13);
        _contentPrice.textAlignment = NSTextAlignmentLeft;
    }
    return _contentPrice;
}

@end
